package com.zl.basic.model;

/**
 * web层与service层或者dao层传递数据 User: zl email:c3tc3tc3t@126.com Date: 14-1-8 Time: 上午11:02
 */
public class SystemContext {
  /**
   * 分页大小
   */
  private static ThreadLocal<Integer> pageSize = new ThreadLocal<>();

  /**
   * 分页的起始条数，从多少条开始
   */
  private static ThreadLocal<Integer> pageOffset = new ThreadLocal<>();

  /**
   * 列表的排序字段
   */
  private static ThreadLocal<String> sortkey = new ThreadLocal<>();

  /**
   * 列表的排序方式升序还是降序
   */

  private static ThreadLocal<String> order = new ThreadLocal<>();
  /**
   * 存储附件在硬盘上的存储路径
   */
  private static ThreadLocal<String> realPath = new ThreadLocal<>();

  public static String getRealPath() {
    return realPath.get();
  }

  public static void setRealPath(String _realPath) {
    realPath.set(_realPath);
  }

  public static void removeRealPath() {
    realPath.remove();
  }

  public static Integer getPageSize() {
    return pageSize.get();
  }

  public static void setPageSize(Integer _pageSize) {
    pageSize.set(_pageSize);
  }

  public static Integer getPageOffset() {
    return pageOffset.get();
  }

  public static void setPageOffset(Integer _pageOffset) {
    pageOffset.set(_pageOffset);
  }

  public static String getSortkey() {
    return sortkey.get();
  }

  public static void setSortkey(String _sortkey) {
    sortkey.set(_sortkey);
  }

  public static String getOrder() {
    return order.get();
  }

  public static void setOrder(String _order) {
    order.set(_order);
  }

  public static void removePageSize() {
    pageSize.remove();
  }

  public static void removePaseOffset() {
    pageOffset.remove();
  }

  public static void removeSortKey() {
    sortkey.remove();
  }

  public static void removeOrder() {
    order.remove();
  }


}
